#include <stdio.h>
#include <string.h>

int main() {
	char str1[20] = "Hello";
	char str2[20] = "World";
	char str3[20];
	printf("Length of str1 is %d\n", strlen(str1));
	strcpy(str3, str1);
	printf("str3 after strcpy: %s\n", str3);
	strcat(str1, str2);
	printf("str1 after strcat: %s\n", str1);
	if (strcmp(str1, str2) == 0) {
		printf("str1 and str2 are equal\n");
	}
	else {
		printf("str1 and str2 are not equal\n");
	}
	char* p = strchr(str1, 'o');
	printf("First occurrence of 'o' in str1 is at position %d\n", p - str1);
	char* q = strstr(str1, "World");
	printf("First occurrence of 'World' in str1 is at position %d\n", q - str1);
	return 0;
}

int finalValueAfterOperations(char** operations, int operationsSize) {
	int i;
	int x = 0;
	for (i = 0; i < operationsSize; i++) {
		if (!strcmp(operations[i], "X++") || !strcmp(operations[i], "++X")) {
			x++;
		}
		else {
			x--;
		}
	}
	return x;
}